﻿
Imports extremo
Public Class DeporteEliminar
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim id = Request.Params.Get("id")

        Dim negocio = New DeporteNegocio
        Dim modelo = negocio.obtener(id)

        Me.txtiddeporte.Value = modelo.iddeporte
        Me.txtNombre.Text = modelo.nombre
        Me.txtDescripcion.Text = modelo.descripcion


    End Sub

    Protected Sub btnEliminar_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnEliminar.Click

        Try
            Dim negocio = New DeporteNegocio
            negocio.eliminar(Me.txtiddeporte.Value)
            Response.Redirect("Deportes.aspx", True)
        Catch ex As Exception
            Response.Write("No se pudo eliminar")
        End Try

    End Sub

    Protected Sub btnRegresar_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnRegresar.Click
        Response.Redirect("Deportes.aspx", True)

    End Sub
End Class